﻿using System;
using System.IO;

class Program
{
    static void Main()
    {
        Console.WriteLine("请输入第一个文本文件的完整路径:");
        string firstFilePath = Console.ReadLine();

        Console.WriteLine("请输入第二个文本文件的完整路径:");
        string secondFilePath = Console.ReadLine();

        try
        {
            string firstFileContent = File.ReadAllText(firstFilePath);
            string secondFileContent = File.ReadAllText(secondFilePath);

            string combinedContent = firstFileContent + secondFileContent;

            string dataDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Data");
            if (!Directory.Exists(dataDirectory))
            {
                Directory.CreateDirectory(dataDirectory);
            }

            string outputFilePath = Path.Combine(dataDirectory, "merged.txt");
            File.WriteAllText(outputFilePath, combinedContent);

            Console.WriteLine("文件合并成功，合并后的文件位于: " + outputFilePath);
        }
        catch (Exception ex)
        {
            Console.WriteLine("合并文件时出错: " + ex.Message);
        }
    }
}